/*
 * usart.h
 *
 *  Created on: 07.02.2012
 *      Author: Roma Jam
 */

#ifndef USART_H_
#define USART_H_

#include "stm32f10x.h"
#include "stm32f10x_rcc.h"
#include "stm32f10x_gpio.h"

#define USART1_CLK          RCC_APB2Periph_USART1
#define USART1_TX_PIN       GPIO_Pin_9
#define USART1_RX_PIN       GPIO_Pin_10
#define USART1_GPIO         GPIOA
#define USART1_GPIO_CLK     RCC_APB2Periph_GPIOA


#define USART2_CLK          RCC_APB1Periph_USART2
#define USART2_TX_PIN       GPIO_Pin_2
#define USART2_RX_PIN       GPIO_Pin_3
#define USART2_GPIO         GPIOA
#define USART2_GPIO_CLK     RCC_APB2Periph_GPIOA


class usart_t {
private:
public:
    void Init(void);
    void Task(void);
    void Print (uint8_t AByte);
    void Send (uint16_t AByte);
    void Print_Char (uint8_t DChar);
    void Print_String (const char *R);
    void Print_Uint (uint16_t ANumber);
};
extern usart_t Usart;

#endif /* USART_H_ */
